package cn.wolfcode.order.domain;

import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.math.BigDecimal;

import static cn.wolfcode.order.util.OrderConst.*;
/**
 *
 */
@Getter@Setter
public class OrderInfo implements Serializable{
    private long orderId;

    private String orderSn;

    private long userId;

    private int orderStatus;//订单状态

    private int shippingStatus;//物流状态

    private int payStatus;//支付状态

    private String consignee;

    private String country;

    private String province;

    private String city;

    private String district;

    private String address;

    private String zipcode;

    private String tel;

    private String mobile;

    private String email;

    private String bestTime;

    private String signBuilding;

    private String postscript;

    private long shippingId;

    private String shippingName;

    private long payId;

    private String payName;

    private String howOos;

    private String howSurplus;

    private String packName;

    private String cardName;

    private String cardMessage;

    private String invPayee;

    private String invContent;

    private BigDecimal goodsAmount;

    private BigDecimal shippingFee;

    private BigDecimal insureFee;

    private BigDecimal payFee;

    private BigDecimal packFee;

    private BigDecimal cardFee;

    private BigDecimal moneyPaid;

    private BigDecimal surplus;

    private int integral;

    private BigDecimal integralMoney;

    private BigDecimal bonus;

    private BigDecimal orderAmount;

    private Short fromAd;

    private String referer;

    private long addTime;

    private long confirmTime;

    private long payTime;

    private long shippingTime;

    private long packId;

    private long cardId;

    private long bonusId;

    private String invoiceNo;

    private String extensionCode;

    private long extensionId;

    private String toBuyer;

    private String payNote;

    private long agencyId;

    private String invType;

    private BigDecimal tax;

    private Boolean isSeparate;

    private long parentId;

    private BigDecimal discount;

    private int orderType;
    /**
     * 重写getOrderStatus
     * @return
     */
    public String getOrderStatus(){
        switch (this.orderStatus){
            case UN_CONFIRMED_ORDER:
                return "未确认";
            case HAS_CONFIRMED_ORDER:
                return "已确认";
            case HAS_COMPLETE_ORDER:
                return "已完成";
            default:
                return "";
        }
    }

    /**
     * 重写getPayStatus
     * @return
     */
    public String getPayStatus(){
        switch (this.payStatus){
            case HAS_PAY_ORDER:
                return "已支付";
            case UN_PAY_ORDER:
                return "未支付";
            default:
                return "";
        }
    }

    /**
     * 重写 getShippingStatus
     * @return
     */
    public String getShippingStatus(){
        switch (this.shippingStatus){
            case UN_SHIP_GOODS:
                return "未发货";
            case HAS_SHIP_GOODS:
                return "已发货";
            case HAS_DELIVERY_GOODS:
                return "已收货";
                default:
                    return"";
        }
    }

}